<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.appspot.gaebirds.TwitterStatus" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="JavaScript">
<!--
function displayDelLink() {
	var del=document.getElementById("del");
	del.style.display="inline";
}
function hideDelLink() {
	var del=document.getElementById("del");
	del.style.display="none";
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="Dr. Yang's Twitter client, a OAuth enabled Twitter client.">
<meta name="keywords" content="twitter, client, oauth">
<title>DR YANG's Twitter Client</title>
</head>
<body>
<h3>DR YANG's Twitter Client</h3>
<% String lastUpdatedStatus = (String) session.getAttribute("last_udpated_status");
   if (lastUpdatedStatus != null && !lastUpdatedStatus.equals("")) {
 %>
<p onMouseOver="displayDelLink()" onMouseOut="hideDelLink()">
<i>Last update: <%= lastUpdatedStatus %></i>
<a id="del" style="display:none" href="twitterwebclient?action=delete">
<img src="Gnome-Edit-Delete-32.png" width="16" height="16" alt="Delete" border="0"/>
</a>
</p>
<%
   }
 %>
<form action="twitterwebclient" method="post">
<textarea cols="40" rows="2" name="status"></textarea>
<br/>
<input type="submit" name="action" value="update"/>
</form>
<% TwitterStatus[] tss = (TwitterStatus[]) session.getAttribute("friends_timelines");
   if (tss != null && tss.length > 1) {
 %>
<p>
<table>
<%   for (int i = 0; i < tss.length; i++) {
	   TwitterStatus ts = tss[i];
 %>
  <tr style="font-size:80%;">
    <td><b><%= ts.getCreatedUser() %></b></td>
    <td><%= ts.getMessage() %></td>
  </tr>
<%
     }
 %>
</table>
<form action="twitterwebclient" method="post">
<input type="submit" name="action" value="more"/>&nbsp;
<input type="submit" name="action" value="latest"/>
</form>
</p>
<%
   }
 %>
</body>
</html>